
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/ui/map/controller.dart';

class MapPage extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    return GetBuilder<MapController>(
      init: MapController(),
        builder:(controller){
        return Scaffold(
          appBar: AppBar(title: Text('高德地图'),actions: <Widget>[
            TextButton(onPressed: (){
              controller.startLocation();
            }, child: Text('定位',style: TextStyle(color: Colors.white)))
          ],),
          body: AMapWidget(
            apiKey: controller.amapApiKeys,
            privacyStatement: controller.amapPrivacyStatement,
          ),
        );
        });
  }
}